home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #6 / Amiga Plus CD - 2004 - No. 06.iso / AmigaPlus / Begleitmaterial / 50Tools / Grafik / PerfectPaint / rexx / Anim / Shaker.rx < prev    next >
Text File  |  2001-10-01  |  1KB  |  115 lines

  1. /*     arexx Script 
  2.     Fade in Black
  3. */
  4.  
  5.     options results
  6.     parse ARG Port b
  7.     
  8.     ADDRESS value Port
  9.  
  10.     pp_CountFrames
  11.     nb=result
  12.     if nb<2 then do
  13.         pp_Warn 'Make*an*Anim*first.'
  14.         EXIT
  15.     end
  16.  
  17.     pp_GetWidth
  18.     w=result
  19.     pp_GetHeight
  20.     h=result
  21.  
  22.     Pw=1
  23.     Op=100
  24.     pp_DialogInit 250 120 "*Shaker*" 4
  25.         pp_Slider 0 100 5 100 16 "Start*Frame*#" 1 1 nb 1
  26.         pp_Slider 1 100 25 100 16 "End*Frame*#" 1 1 nb nb
  27.         pp_Slider 2 100 45 100 16 "Power" 1 1 20 Pw
  28.         pp_Slider 3 100 65 100 16 "Opacity" 1 1 100 Op
  29.     pp_Dialog
  30.     rc=result
  31.     if rc=0 then
  32.         do
  33.             EXIT
  34.         end        
  35.         
  36.     pp_GetDialog 0
  37.     s0=result
  38.  
  39.     pp_GetDialog 1
  40.     s1=result
  41.  
  42.     pp_GetDialog 2
  43.     Pw=result
  44.  
  45.     pp_GetDialog 3
  46.     Op=result
  47.  
  48.     pp_FindEmptyBrush
  49.     Brush=result
  50.     pp_SetBrush Brush
  51.  
  52.     pp_ClosestColor 0 0 0
  53.     color=result
  54.     pp_SetBpen color
  55.  
  56.     DO i=s0 to s1
  57.         xr=trunc(random(0,1,time('S')),0)
  58.         xr2=trunc(random(0,Pw,time('S')),0)
  59.         yr=trunc(random(0,1,time('S')),0)
  60.         yr2=trunc(random(0,Pw,time('S')),0)
  61.  
  62.         IF xr=0 then DO
  63.             xr2=xr2*-1
  64.         END
  65.  
  66.         IF yr=0 then DO
  67.             yr2=yr2*-1
  68.         END
  69.  
  70.         pp_GotoFrame i
  71.         pp_pickbrush 0 0 w h 1
  72.         IF Op=100 then DO
  73.             pp_Cls
  74.         END
  75.         ELSE DO
  76.             pp_BrushOpacity Op
  77.         END
  78.         pp_Plot w/2+xr2 h/2+yr2
  79.  
  80.     END
  81.  
  82.     pp_GotoFrame s0
  83.  
  84.     pp_BrushOpacity 100
  85.     pp_FreeBrush
  86.     pp_SetBrush CB
  87.     
  88.     EXIT    
  89.  
  90.     
  91.  
  92.  
  93.     sp=100/(s1-s0+1)
  94.     pp_EffectOn
  95.  
  96.     pp_GotoFrame s0
  97.  
  98.     if fade=1 then
  99.     DO
  100.     do i=sp to 100 by sp
  101.         pp_Shade i
  102.         pp_BoxF 0 0 w h
  103.         pp_NextFrame
  104.     end 
  105.     END
  106.     ELSE
  107.     sp2=sp*-1
  108.     DO
  109.     do i=100 to sp by sp2
  110.         pp_Shade i
  111.         pp_BoxF 0 0 w h
  112.         pp_NextFrame
  113.     end 
  114.     END
  115.